#ifndef DEPARTMENTPAGE_H
#define DEPARTMENTPAGE_H

#include "doctorsindepartmentpage.h"

#include <QWidget>
#include <QTableWidget>
#include <QMessageBox>
#include <QDebug>
#include <../Tools/clienttcp.h>

class DepartmentPage : public QWidget {
    Q_OBJECT

public:
    explicit DepartmentPage(QWidget *parent = nullptr);

    void setupTable(const QList<QJsonObject> &departmentsData);
signals:
    void departmentSelected(const QString &departmentName); // 信号，表示部门被选中

public slots:
    void loadData();
private:
    QTableWidget *tableWidget;
    ClientTcp *tcp;
    DoctorsInDepartmentPage * dp;
    void onDepartmentClicked(int row, int column); // 槽函数
    ~DepartmentPage(); // 明确声明析构函数
};

#endif // DEPARTMENTPAGE_H
